import { Button } from 'antd'
import { useSelector, useDispatch } from 'react-redux'
import { increase, decrease, setCount, addAmountAsync, addAmountAsync1 } from '@/store/modules/counterStore'
const ReduxPage: React.FC = () => {
    const { count } = useSelector((state: RootState) => state.counter)
    const disPatch: AppDispatch = useDispatch()
    return (<>
        <div>
            <Button onClick={() => disPatch(increase())}>自增</Button>
            <span>ReduxPage学习{count}</span>
            <Button onClick={() => disPatch(decrease())}>自减</Button>
            <Button onClick={() => disPatch(setCount(10))}>设置大小为10</Button>
            <Button onClick={() => disPatch(addAmountAsync())}>异步方法增加</Button>
            <Button onClick={() => disPatch(addAmountAsync1())}>异步方法1增加</Button>
        </div>
    </>)
}
export default ReduxPage